<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta charset="utf-8">
<title>销售订单表</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../res/css/layui.css" media="all">
<link rel="stylesheet" href="../../res/css/cst/snproduction.css" media="all">
<script type="text/javascript" src="../../res/js/jquery-1.11.2.min.js"></script>
</head>
<style>
.layui-table td{text-align:center};

.retailNumber{
	width: 200px;
	height: 28px;
	border: none;
	text-align: center;
}
#claseTable tr th{
	text-align: center;
}
</style>
<body>
	 <div class="demoTable" style="margin-left:20px;margin-top: 10px;">
	            <!--     操作人：
		  <div class="layui-inline">
		    <input class="layui-input" style="height:32px;" name="id" id="demoReload" autocomplete="off">
		  </div> -->
		    操作时间：
		  <div class="layui-inline">
		    <input class="layui-input" style="height:32px;" name="id" id="date" placeholder="yyyy-MM-dd" autocomplete="off">
		  </div>
		     结束时间:
		  <div class="layui-inline">
		    <input class="layui-input" style="height:32px;" name="id" id="time" placeholder="yyyy-MM-dd" autocomplete="off">
		  </div>
		  <button class="layui-btn layui-btn-sm" data-type="reload" id="selectButton">搜索</button>
		  <button class="layui-btn layui-btn-sm" id="insert">增加</button>
	</div>
	<table class="layui-table" lay-data="{ url:'../../Retail/findAll.action', page:true, id:'idTest'}" lay-filter="demo">
	  <thead>
	    <tr>
	   <!--   <th lay-data="{type:'checkbox', fixed: 'left'}"></th>  -->
	      <th lay-data="{field:'reId', fixed: true, align:'center'}">销售ID</th>
	      <th lay-data="{field:'oper', align:'center'}">销售人</th>
	      <th lay-data="{field:'optime', align:'center'}">操作时间</th>
	      <th lay-data="{field:'reCount', align:'center'}">销售总数</th>
	      <th lay-data="{field:'reSum', align:'center'}">销售总金额</th>
		  <th lay-data="{field:'reChange', align:'center'}">销售找零</th>
	      <th lay-data="{field:'reState', align:'center',templet:'#imgTpl'}">零售状态</th>
	      <th lay-data="{fixed: 'right', align:'center',toolbar:'#barDemo',width:'250'}">操作</th>
	    </tr>
	  </thead>
	</table>
<script type="text/javascript" id="imgTpl">
	{{# if(d.reState == 2) { }}
		<div>零售失败</div>
	{{# } else if(d.reState == 1){ }}
		<div>零售成功</div>
	{{# }else if(d.reState == 3){ }}
		<div>等待退货审核</div>
	{{# }else if(d.reState == 4){ }}
		<div>审核通过：等待确认</div>
	{{# }else if(d.reState == 5){ }}
		<div>已退货</div>
	{{# }}}
</script>
<script type="textml" id="Image">
    <img style="width:30px;height:30px;" src="../../{{ d.comImage }}">
</script>
<script type="text/html" id="barDemo">
  <a class="layui-btn layui-btn-xs" lay-event="detail">查看详情</a>
  <button class="layui-btn layui-btn-xs">发票</button>

	{{# if(d.reState == 3) { }}
		<a class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled">等待审核</a>	
	{{# } else if(d.reState <=2){ }}
		<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="salse">退货</a>	
	{{# } else if(d.reState ==4){ }}
		<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="que">确认退货</a>	
	{{# } else if(d.reState ==5){ }}
		<a class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled">已退货</a>	
	{{# }}}
  
</script>
<script type="text/html" id="barDemo2">
  	<a class="layui-btn layui-btn-xs" lay-event="zj">加入订单</a>
</script>         
<!-- 增加的弹框 -->
<div id="addOrUpdate" style="display: none;">
	<div class="demoTable" style="margin-left:20px;margin-top: 10px;">
		请输入会员电话号码：
		<div class="layui-inline">
			<input class="layui-input" id="phone" style="height: 34px;" placeholder="会员电话号码" autocomplete="off" onkeyup="this.value=this.value.replace(/\D/g,'')">
		</div>
		<button class="layui-btn layui-btn-sm" id="selectphone">搜索</button>
		<span id="msg" style="margin-left: 30px;color: red;font-size: 11px;"/>
	</div>
	<input type="hidden" id="comId">
	<input type="hidden" id="memberId">
	<table class="layui-table" lay-filter="demo" style="table-layout:fixed;">
		<thead>
			<tr>
				<th style="width:175px; text-align:center;">零售码</th>
				<th style="text-align:center;">零售名称</th>
				<th style="text-align:center;">零售单位</th>
				<th style="text-align:center;">建议零售价</th>
				<th style="text-align:center;">零售数量</th>
				<th style="text-align:center;">应收金额</th>
				<th style="text-align:center;">操作</th>
			</tr>
		</thead>
		<tbody id="tbody">
			
		</tbody>	
	</table>
	    
	<div class="demoTable" style="margin-left: 20px; margin-top: 20px; display:inline" >
			搜索：
			<div class="layui-inline">
				<input class="layui-input" id="snacks" style="height: 34px;" placeholder="请输入零食名称" autocomplete="off">
			</div>
			
			<div class="layui-inline">
				<input class="layui-input" type="number" style="height: 34px;" id="snacksNum" placeholder="￥" autocomplete="off" style="width: 100px;"/>
			</div>
			-
			<div class="layui-inline">
				<input class="layui-input" type="number" style="height: 34px;" id="snacksNum2" placeholder="￥" autocomplete="off" style="width: 100px;"/>
			</div>
			　
			<button style="margin-left:10px;" class="layui-btn layui-btn-sm" data-type="suwhdetail" id="selectButtons">搜索</button>
			<button class="layui-btn layui-btn-sm" data-type="reloads" id="jiesuan">结算</button>
			<button class="layui-btn layui-btn-sm" data-type="reloads" id="quxiao">全部取消</button>
			<span style="position:relative;right:10px;top:7px;font-size:14px;font-weight:bold;float:right;color:#e02b41;">总金额为：<font id="heji">0</font>￥</span>
			
		</div>
		<table class="layui-table" lay-data="{ url:'../../wholeSale/queryBraProduction.action', page:true, id:'test2'}" lay-filter="insCom">
			  <thead>
				<tr>
					<th lay-data="{field:'comId',align:'center'}">商品Id</th>
					<th lay-data="{field:'typeName',align:'center'}">商品类型</th>
					<th lay-data="{field:'comName', align:'center'}">商品名称</th>
					<th lay-data="{field:'comImage', align:'center',toolbar: '#Image'}">商品图片</th>
					<th lay-data="{field:'comUnit', align:'center'}">商品单位</th>
					<th lay-data="{field:'ciRetail',sort: true, align:'center'}">零售价</th>
					<th lay-data="{field:'ciInventory',sort: true, align:'center'}">商品库存量</th>
					<th lay-data="{fixed: 'right',align:'center',toolbar: '#barDemo2'}">操作</th>
				</tr>
			</thead>
		</table>
</div>
<div id="calseDiv" style="display: none;">
 <div class="demoTable" style="margin-left:20px;margin-top: 15px">
 	<input id="comment" placeholder="请输入退货意见：" style="width:300px;height:35px;">
 	<button class="layui-btn layui-btn-sm" id="tui" style="position: absolute;margin: auto;top: 19px;margin-left: 10px">确认退货</button>
 </div>
	 
	<table id="claseTable" class="layui-table" id="test3" lay-filter="insCom">
			  <thead>
				<tr>
					<th lay-data="{field:'sdCount', align:'center'}">退货商品</th>
					<th lay-data="{field:'sdCount', align:'center'}">总数量</th>
					<th lay-data="{field:'sdAlready', align:'center'}">退货数量</th>
					<th lay-data="{field:'optime',sort: true, align:'center'}">操作时间</th>
				</tr>
			</thead>
			<tbody id="retaTbody">
				
			</tbody>
		</table>
</div>
<script src="../../res/layui.all.js" charset="utf-8"></script>
<script type="text/javascript" src="../../res/js/zh/snretail.js"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
</body>
</html>